import requests

import config


class OrderAPI:
    def __init__(self):
        self.url_order_list = config.BASE_URL + "/v1/order/by_user?page=1"
        self.url_add_order = config.BASE_URL + "/api/v1/order"
        self.url_order = config.BASE_URL + "/api/v1/order/{}"

    def get_order_list(self):
        return requests.get(url=self.url_order_list,headers={"token":config.token})

    def get_add_order(self,add_data):
        return requests.post(url=self.url_add_order,json=add_data,headers={"token":config.token})
    def get_order(self,order_id):
        return requests.get(url=self.url_order.format(order_id),headers={"token":config.token})